package wangbaguanlixitong.servlet;

import wangbaguanlixitong.dao.HyDao;
import wangbaguanlixitong.model.Hy;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.sql.ResultSet;
import java.util.List;

@WebServlet(name = "LookHyServlet",urlPatterns ="/hylook")
public class HYLookServlet extends HttpServlet {
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {

        response.setContentType("text/html;charset=utf-8");
        //查看会员
        Hy hy = new Hy();
        //todo 查找目录


        HyDao hydao = new HyDao();
//        request.setAttribute("card",hy.getCard());
//        request.setAttribute("name",hy.getName());
//        request.setAttribute("idcard",hy.getIdcard());
//        request.setAttribute("sex",hy.getSex());
//        request.setAttribute("age",hy.getAge());
//        request.setAttribute("tel",hy.getTel());
//        request.setAttribute("yuan",hy.getYuan());
        List<Hy> selecthuiyuan = hydao.selecthuiyuan();
        request.setAttribute("hyList",selecthuiyuan);


        request.getRequestDispatcher("lookhuiyuan.jsp").forward(request,response);


    }

    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        this.doPost(request, response);
}
}
